package cn.yh.hospitalappointmentsystemdemo.controller;

import cn.yh.hospitalappointmentsystemdemo.common.AjaxResult;
import cn.yh.hospitalappointmentsystemdemo.domain.vo.DepartmentVo;
import cn.yh.hospitalappointmentsystemdemo.service.IDepartmentsService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
@Api(tags = "科室管理")
@RestController
@RequestMapping("/departments")
public class DepartmentsController {

    @Autowired
    private IDepartmentsService departmentsService;

    @GetMapping("/list")
    public AjaxResult departmentsList() {
        List<DepartmentVo> departmentList = departmentsService.departmentList();
        return AjaxResult.success(departmentList);
    }
}
